package com.financial.sys.controller.bid;


import com.financial.common.vo.Result;
import com.financial.model.pojo.TBid;
import com.financial.sys.service.bid.TBidService;
import com.financial.sys.vo.bid.QueryObject;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author zw
 * @since 2020-02-12
 */
@RestController
@Api (value = "TBidController", description = "投标")
@RequestMapping ("/finance/bid")
public class TBidController {
	@Autowired
	TBidService tBidService;

	//1
	@ApiOperation (value = "分页查询前台用户的投标信息")
	@PostMapping ("/query")
	public Result getBidQuery(QueryObject queryObject) {
		return Result.ok().data(tBidService.getBidQuery(queryObject));
	}


	@ApiOperation (value = "查询标的的投标列表信息")
	@PostMapping ("/getByBorrowId/{borrowId}")
	public Result getByBorrowId(@PathVariable ("borrowId") String borrowId) {
		return Result.ok().data(tBidService.getByBorrowId(borrowId));
	}

	@ApiOperation (value = "发起投标,新增投标")
	@PostMapping ("/add")
	public Result addBid(TBid bid) {
		tBidService.addBid(bid);
		return Result.ok();
	}
}

